#include "Common.h"

initSing(InterfaceHandler);

InterfaceError InterfaceHandler::QueryInterface(Interfaces type, void** pOut)
{
	if(!pOut)
		return QUERY_INTERFACE_POINTER_UNINIT;
	if(type >= NUM_INTERFACES)
		return QUERY_INTERFACE_UNK_INTERFACE;

	IUnkInterface* iun = m_interfaces[type];
	if(!iun || iun->InterfaceType != type)
		return QUERY_INTERFACE_NOT_AVAILABLE;

	*pOut = iun;
	return QUERY_INTERFACE_SUCCESS;
}